﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using TSqlServer;

public partial class system_chkapply_list : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (IsPostBack)
        {
        }
        else
        {
            string stat = Request["status"].ToString();
            string pagenum = Request["pagenum"].ToString();

            checkmans.Text = GetLinkmans(stat, pagenum);
        }
    }

    private string GetLinkmans(string stat, string pagenum)
    {
        string result = "<table border=0 align=center width=98%><tr><td>";

        result += "<table id=\"mymans\" border=\"0\" cellpadding=\"1\" cellspacing=\"2\" align=\"left\" width=100%>";
        result += "<thead>";
        result += "<tr height=30>";
        result += "<td class=\"thead00\" align=center>序号</td>";
        result += "<td class=\"thead00\">姓名</td>";
        result += "<td class=\"thead00\">公司</td>";
        result += "<td class=\"thead00\">部门</td>";
        result += "<td class=\"thead00\">职位</td>";
        result += "<td class=\"thead00\">单位类型</td>";
        result += "<td class=\"thead01\" align=center nowrap=\"nowrap\">赠阅级别</td>";
        result += "<td class=\"thead01\" align=center nowrap=\"nowrap\">赠阅类型</td>";
        result += "<td class=\"thead01\" align=center nowrap=\"nowrap\">期刊</td>";
        result += "<td class=\"thead01\" nowrap=\"nowrap\">数量</td>";
        result += "<td class=\"thead01\">赠阅理由</td>";
        result += "<td class=\"thead01\" align=center nowrap=\"nowrap\">开始时间</td>";
        result += "<td class=\"thead01\" align=center nowrap=\"nowrap\">终止时间</td>";
        result += "<td class=\"thead01\" align=center nowrap=\"nowrap\">赠阅人</td>";
        result += "<td class=\"thead01\" align=center colspan=2>批复</td>";
        result += "</tr>";
        result += "</thead>";

        result += "<tbody>";
        TLinkmanGive oList = new TLinkmanGive();
        oList.GetPage(Convert.ToInt32(pagenum), Convert.ToInt32(stat));
        while (oList.RResults.Read())
        {
            string uid = oList.RResults.GetValue(oList.RResults.GetOrdinal("uid")).ToString();
            result += "<tr id=\"" + uid + "\" height=22>";
            result += "<td nowrap=\"nowrap\" align=center>" + oList.RResults.GetValue(oList.RResults.GetOrdinal("rownum")).ToString() + "</td>";
            result += "<td nowrap=\"nowrap\">" + oList.RResults.GetValue(oList.RResults.GetOrdinal("linkman")).ToString() + "</td>";
            result += "<td>" + oList.RResults.GetValue(oList.RResults.GetOrdinal("company")).ToString() + "</td>";
            result += "<td nowrap=\"nowrap\">" + oList.RResults.GetValue(oList.RResults.GetOrdinal("dept")).ToString() + "</td>";
            result += "<td nowrap=\"nowrap\">" + oList.RResults.GetValue(oList.RResults.GetOrdinal("jobposi")).ToString() + "</td>";
            result += "<td nowrap=\"nowrap\">" + oList.RResults.GetValue(oList.RResults.GetOrdinal("unittype")).ToString() + "</td>";
            result += "<td align=center nowrap=\"nowrap\">" + oList.RResults.GetValue(oList.RResults.GetOrdinal("givelvl")).ToString() + "</td>";
            result += "<td align=center nowrap=\"nowrap\">" + oList.RResults.GetValue(oList.RResults.GetOrdinal("givetype")).ToString() + "</td>";
            result += "<td nowrap=\"nowrap\">" + oList.RResults.GetValue(oList.RResults.GetOrdinal("givemag")).ToString() + "</td>";
            result += "<td align=center>" + oList.RResults.GetValue(oList.RResults.GetOrdinal("giveqty")).ToString() + "</td>";
            //result += "<td nowrap=\"nowrap\">" + oList.RResults.GetValue(oList.RResults.GetOrdinal("giveexpl")).ToString() + "</td>";
            result += "<td>" + oList.RResults.GetValue(oList.RResults.GetOrdinal("giveexpl")).ToString() + "</td>";
            result += "<td align=center nowrap=\"nowrap\">" + ((DateTime)oList.RResults.GetValue(oList.RResults.GetOrdinal("givebdate"))).ToString("yy-MM-dd") + "</td>";
            result += "<td align=center nowrap=\"nowrap\">" + ((DateTime)oList.RResults.GetValue(oList.RResults.GetOrdinal("giveedate"))).ToString("yy-MM-dd") + "</td>";
            result += "<td align=center nowrap=\"nowrap\">" + oList.RResults.GetValue(oList.RResults.GetOrdinal("giveman")).ToString() + "</td>";
            result += "<td class=\"td01\" width=40 align=center onclick=\"ispass('" + uid + "','4')\">同意</td>";
            result += "<td class=\"td02\" width=40 align=center onclick=\"ispass('" + uid + "','5')\">不同意</td>";
            result += "</tr>";
        }
        result += "</tbody>";

        result += "</table>";
        result += "</td></tr><tr><td>";

        result += oList.GenPagebar(Convert.ToInt32(pagenum), Convert.ToInt32(stat)) + "</td></tr></table>";

        return result;
    }
}
